package com.ddwl.user.repository;

import com.ddwl.user.dao.model.Device;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2021/6/1 21:54
 */
public interface DeviceRepository extends MongoRepository<Device, String>, DeviceRepositoryAdvance {

    List<Device> findByUserIdAndPlatform(String userId, String platform);

    Device findByUserIdAndMac(String userId, String mac);

    void deleteByUserIdAndMac(String userId, String mac);

    Integer countByMac(String mac);

    Device findTopByMac(String mac);

    List<Device> findByConnected(Integer connected);
}
